﻿import layer_certain from "./layer_certain/layer_certain.js"; //certain弹出层
import letter_yzwm from "./Letter/Letter.js";
import Exchange from "./Exchange/get_my_exchange";
import Send_man from "./Send_Man/Send_man";
import Advance from "./Advance/Advance";
import set_b_m from "./set_Beginner_Mode/set_B_M.js";
import set_common_card from "./common_card/set_common_card.js";
import set_Page_refresh from "./Page_refresh/Page_refresh.js";
import user_index from "./user_index/user_index.js";
import first_view from "./first_view/first_vievw.js";
let _this = {
  //change_footer_btn_act
  change_footer_btn_act(state, obj){
    for(let x in state.footer_menu_list){
      state.footer_menu_list[x].sign_c = false;
    }
    state.footer_menu_list[obj.num].sign_c = true;
  },
  change_footer_qxt_btn_act(state, obj){
    for(let x in state.footer_menu_list){
      state.qxt_footer_menu_list[x].sign_c = false;
    }
    state.qxt_footer_menu_list[obj.num].sign_c = true;
  },
  //保存wx 地址中获取的 用户id
  set_wx_user_id(state, id) {
      state.wx_user_id = id
  },
  get_user_info(state,obj){
    state.user_info = obj
  },
  M_BottomClick(id) {
    //前一次的点击按钮的状态改变
    state.BottomBtn[BottomBtn_pre_click].click = false
    //当前点击的状态改变
    state.BottomBtn[id].click = true
  },
  redirect(state, payload) {
    state.footer_menu_list
  },
  //出库 bottom_btn style change
  bottom_btn_f (state,obj) {
    state.bottom_btn[state.pre_bottom_click].c_sign = false;
    state.bottom_btn[obj.index].c_sign = true;
    state.pre_bottom_click = obj.index;
  },
  Loading_show(state){
    conosle.log(")_)_)_)_)_)_)_)_)_)_)______________)))))))))))))_))))))))))")
    console.log(state.Loading_show)
    state.Loading_show
  },
  close_loading_mask(state){
    state.Loading_show = false
  },
  show_loadin_mask(state){
    state.Loading_show = true
  },
  Change_loading_show(state){
    // if( state.Loading_show == false){
    //   state.Loading_show = true
    // }
    state.Loading_show = !state.Loading_show
  },
  //in page get_mess secondary_category
  //改变in 的bottom_btn
  Change_bottom_btn(state,obj){
    let new_obj = {};
    //nor
    for(let x = 0;x < 8; x++) {
      if( x == 7 ){
        new_obj[x+1] = {c_sign:false,text:"其他",del:false,index:x+1,other:{},id:obj[x].id}
        break;
      }
      if( x == 0 ){
        new_obj[x+1] = {c_sign:true,text:obj[x].name,del:false,index:x+1,id:obj[x].id}
        continue;
      }
      new_obj[x+1] = {c_sign:false,text:obj[x].name,del:false,index:x+1,id:obj[x].id}
    }
    //other
    for(let x = 8 ;x < obj.length ;x++){
      new_obj[8].other[x] = {c_sign:false,text:obj[x].name,del:false,index:x+1,id:obj[x].id}
    }
    //state change
    state.bottom_btn = new_obj
  }
}

Object.assign(_this, Advance);
Object.assign(_this, Exchange);
Object.assign(_this, layer_certain);
Object.assign(_this, letter_yzwm); //Letter
Object.assign(_this, Send_man);
Object.assign(_this, set_b_m);
Object.assign(_this, set_common_card);
Object.assign(_this, set_Page_refresh);
Object.assign(_this, user_index);
Object.assign(_this, first_view);
export default _this
